package com.aiti.lulian.schedule;

import com.aiti.lulian.components.wx.domain.TokenResponse;
import com.aiti.lulian.service.ShowActivityInfoService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.AutoConfigurationPackage;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.http.ResponseEntity;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.web.client.RestTemplate;

import java.util.concurrent.TimeUnit;


@Component
public class ActivityScrawlerSchedule {

    private static final Logger log = LoggerFactory.getLogger(ActivityScrawlerSchedule.class);

    @Autowired
    private ShowActivityInfoService activityInfoService;


    @Scheduled(cron = "0 0 4 1 1/3 ?", zone = "Asia/Shanghai")
    public void addOverseasExhibitionActivities() {
        log.info("开始执行海外展会数据抓取任务...");
        activityInfoService.abroadAddEShow365Activity();
    }


    @Scheduled(cron = "0 0 3 1 * ?", zone = "Asia/Shanghai")
    public void addDomesticExhibitionActivities() {
        log.info("开始执行国内展会数据抓取任务...");
        activityInfoService.internalAddEShow365Activity();
    }
}
